// 加载js文件执行代码区
window.onload = function() {
	playbanner();
	changeinputtext();
}
// 头部导航栏的购物车信息显示与隐藏
function showshopadata() {
	var shopdataDom = document.getElementsByClassName("shopdata")[0];
	shopdataDom.style.height = 100 + "px";
}

function hideShopadata() {
	var shopdataDom = document.getElementsByClassName("shopdata")[0];
	shopdataDom.style.height = 0;
}
// 子导航栏
function showitem(n) {
	var itembox = document.getElementsByClassName("navitemdata")[0];
	itembox.style.height = 230 + "px";
	itembox.style.boxShadow = "0 3px 4px rgba(0,0,0,0.18)";
	itembox.style.borderColor = "#e0e0e0";
	if (n == 1) {
		itembox.innerHTML = `<div class="tabbox" onmouseover="showitem(1)">
                                <a href="#">
                                    <img src="./image/d7a15df55e98e4163390096ed05b1ef5.webp">
                                    <p>Xiaomi 12S Ultra</p>  
                                    <p>5999元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/d7a15df55e98e4163390096ed05b1ef5.webp">
                                    <p>Xiaomi 12S Ultra</p>  
                                    <p>5999元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/d7a15df55e98e4163390096ed05b1ef5.webp">
                                    <p>Xiaomi 12S Ultra</p>  
                                    <p>5999元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/d7a15df55e98e4163390096ed05b1ef5.webp">
                                    <p>Xiaomi 12S Ultra</p>  
                                    <p>5999元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/d7a15df55e98e4163390096ed05b1ef5.webp">
                                    <p>Xiaomi 12S Ultra</p>  
                                    <p>5999元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/d7a15df55e98e4163390096ed05b1ef5.webp">
                                    <p>Xiaomi 12S Ultra</p>  
                                    <p>5999元起</p>  
                                </a>
                            </div>`;

	

	} else if (n == 2) {
		itembox.innerHTML = `
                                <div class="tabbox" onmouseover="showitem(2)">
                                <a href="#">
                                    <img src="./image/1e1f915167554e99916273b5269da1b5.webp">
                                    <p>Redmi Note 11T Pro+</p>  
                                    <p>5999元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/1e1f915167554e99916273b5269da1b5.webp">
                                <p>Redmi Note 11T Pro+</p>  
                                    <p>5999元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/1e1f915167554e99916273b5269da1b5.webp">
                                <p>Redmi Note 11T Pro+</p>  
                                    <p>5999元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/1e1f915167554e99916273b5269da1b5.webp">
                                <p>Redmi Note 11T Pro+</p>  
                                    <p>5999元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/1e1f915167554e99916273b5269da1b5.webp">
                                <p>Redmi Note 11T Pro+</p>  
                                    <p>5999元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/1e1f915167554e99916273b5269da1b5.webp">
                                <p>Redmi Note 11T Pro+</p>  
                                    <p>5999元起</p>  
                                </a>
                            </div>`
	} else if (n == 3) {
		itembox.innerHTML = `
                                <div class="tabbox" onmouseover="showitem(3)">
                                <a href="#">
                                    <img src="./image/6511d77270e94146c0b1f96b66d8cc58.webp">
                                    <p>Redmi智能电视X55 2022</p>  
                                    <p>2399元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/6511d77270e94146c0b1f96b66d8cc58.webp">
                                    <p>Redmi智能电视X55 2022</p>  
                                    <p>2399元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/6511d77270e94146c0b1f96b66d8cc58.webp">
                                    <p>Redmi智能电视X55 2022</p>  
                                    <p>2399元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/6511d77270e94146c0b1f96b66d8cc58.webp">
                                    <p>Redmi智能电视X55 2022</p>  
                                    <p>2399元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/6511d77270e94146c0b1f96b66d8cc58.webp">
                                    <p>Redmi智能电视X55 2022</p>  
                                    <p>2399元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/6511d77270e94146c0b1f96b66d8cc58.webp">
                                    <p>Redmi智能电视X55 2022</p>  
                                    <p>2399元起</p>  
                                </a>
                            </div>`
	} else if (n == 4) {
		itembox.innerHTML = `
                                <div class="tabbox" onmouseover="showitem(4)">
                                <a href="#">
                                    <img src="./image/3f306e56e070eec07b985baf8f1f57e8.webp">
                                    <p> Xiaomi Book Pro 14 2022 </p>  
                                    <p>6799元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/3f306e56e070eec07b985baf8f1f57e8.webp">
                                    <p> Xiaomi Book Pro 14 2022 </p>  
                                    <p>6799元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/3f306e56e070eec07b985baf8f1f57e8.webp">
                                    <p> Xiaomi Book Pro 14 2022 </p>  
                                    <p>6799元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/3f306e56e070eec07b985baf8f1f57e8.webp">
                                    <p> Xiaomi Book Pro 14 2022 </p>  
                                    <p>6799元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/3f306e56e070eec07b985baf8f1f57e8.webp">
                                    <p> Xiaomi Book Pro 14 2022 </p>  
                                    <p>6799元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/3f306e56e070eec07b985baf8f1f57e8.webp">
                                    <p> Xiaomi Book Pro 14 2022 </p>  
                                    <p>6799元起</p>  
                                </a>
                            </div>`
	} else if (n == 5) {
		itembox.innerHTML = `
                                <div class="tabbox" onmouseover="showitem(5)">
                                <a href="#">
                                    <img src="./image/33de34a4caf2834a1828dc51203dc922.webp">
                                    <p>小米平板5</p>  
                                    <p>1899元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/33de34a4caf2834a1828dc51203dc922.webp">
                                    <p>小米平板5</p>  
                                    <p>1899元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/33de34a4caf2834a1828dc51203dc922.webp">
                                    <p>小米平板5</p>  
                                    <p>1899元起</p>  
                                </a>
                            </div>`
	} else if (n == 6) {
		itembox.innerHTML = `
                                <div class="tabbox" onmouseover="showitem(6)">
                                <a href="#">
                                    <img src="./image/cbfab8147c1104eea97c7d0f07581237.webp">
                                    <p>巨省电 | 米家空调 新一级 1.5匹 睡眠版</p>  
                                    <p>2199元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/cbfab8147c1104eea97c7d0f07581237.webp">
                                    <p>巨省电 | 米家空调 新一级 1.5匹 睡眠版</p>  
                                    <p>2199元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/cbfab8147c1104eea97c7d0f07581237.webp">
                                    <p>巨省电 | 米家空调 新一级 1.5匹 睡眠版</p>  
                                    <p>2199元起</p>  
                                </a>
                            </div>`
	} else if (n == 7) {
		itembox.innerHTML = `
                                <div class="tabbox" onmouseover="showitem(7)">
                                <a href="#">
                                    <img src="./image/c1465737a8a6ac8772560dce2ef0a39f.webp">
                                    <p>Redmi 电竞路由器 AX5400</p>  
                                    <p>599元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/c1465737a8a6ac8772560dce2ef0a39f.webp">
                                    <p>Redmi 电竞路由器 AX5400</p>  
                                    <p>599元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/c1465737a8a6ac8772560dce2ef0a39f.webp">
                                    <p>Redmi 电竞路由器 AX5400</p>  
                                    <p>599元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/c1465737a8a6ac8772560dce2ef0a39f.webp">
                                    <p>Redmi 电竞路由器 AX5400</p>  
                                    <p>599元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/c1465737a8a6ac8772560dce2ef0a39f.webp">
                                    <p>Redmi 电竞路由器 AX5400</p>  
                                    <p>599元起</p>  
                                </a>
                                <a href="#">
                                    <img src="./image/c1465737a8a6ac8772560dce2ef0a39f.webp">
                                    <p>Redmi 电竞路由器 AX5400</p>  
                                    <p>599元起</p>  
                                </a>
                            </div>`
	}
	
	itembox.querySelector(".tabbox").onmouseover = function(event) {
		console.log(event);
		// if (parseInt(itembox.style.height) > 0) {
		// 	return;
		// }
		itembox.style.height = 230 + "px";
		
		itembox.querySelector(".tabbox").onmouseover = function(){}
	};
	
}

function hideitem() {
	console.log('hideitem');
	var itembox = document.getElementsByClassName("navitemdata")[0];
	itembox.style.height = 0;
	// itembox.style.boxShadow = "";
	// itembox.style.borderColor = "#ffffff";
}
// 搜索框信息
function showselect() {
	var t
	var selectbox = document.getElementsByClassName("selectbox")[0];
	var selecticon = document.getElementsByClassName("selecticon")[0];
	var selectdata = document.getElementsByClassName("selectdata")[0];
	selectbox.style.borderColor = "#ff6700";
	selecticon.style.borderColor = "#ff6700";
	selectdata.style.display = "block";
	selectbox.onmouseover = selectdata.onmouseover = function() {
		selectbox.style.borderColor = "#ff6700";
		selecticon.style.borderColor = "#ff6700";
		selectdata.style.display = "block";
		clearTimeout(t)
	}
	selectbox.onmouseout = selectdata.onmouseout = function() {
		t = setTimeout(() => {
			selectbox.style.borderColor = "#e0e0e0";
			selecticon.style.borderColor = "#e0e0e0";
			selectdata.style.display = "none";
		}, 5000)
	}
}
// 记录轮播到哪一张
var bannernum = 0;
// 一开始就执行定时器轮播图片
var swiper

function playbanner() {
	swiper = setInterval(() => {
		var img = document.getElementsByClassName("banneritem");
		var D = document.getElementsByClassName("bannerD");
		bannernum++;
		if (bannernum == img.length) {
			bannernum = 0;
		}
		for (let i = 0; i < img.length; i++) {
			img[i].style.opacity = 0;
			img[i].style.zIndex = 0;
			D[i].style.backgroundColor = ""
		}
		img[bannernum].style.opacity = 1;
		img[bannernum].style.zIndex = 1;
		D[bannernum].style.backgroundColor = "#ffffff";
	}, 5000)
}
// 下一张轮播图
function nextbanner() {
	clearInterval(swiper);
	var img = document.getElementsByClassName("banneritem")
	var D = document.getElementsByClassName("bannerD");
	bannernum++;
	if (bannernum == img.length) {
		bannernum = 0;
	}
	for (let i = 0; i < img.length; i++) {
		img[i].style.opacity = 0;
		img[i].style.zIndex = 0;
		D[i].style.backgroundColor = ""
	}
	img[bannernum].style.opacity = 1;
	img[bannernum].style.zIndex = 1;
	D[bannernum].style.backgroundColor = "#ffffff";
	playbanner();
}
// 上一张轮播图
function backbanner() {
	clearInterval(swiper);
	var img = document.getElementsByClassName("banneritem");
	var D = document.getElementsByClassName("bannerD");
	bannernum--;
	if (bannernum == -1) {
		bannernum = 2;
	}
	for (let i = 0; i < img.length; i++) {
		img[i].style.opacity = 0;
		img[i].style.zIndex = 0;
		D[i].style.backgroundColor = ""
	}
	img[bannernum].style.opacity = 1;
	img[bannernum].style.zIndex = 1;
	D[bannernum].style.backgroundColor = "#ffffff";
	playbanner();
}
// 指示点
function bannerD(num) {
	clearInterval(swiper);
	var img = document.getElementsByClassName("banneritem")
	var D = document.getElementsByClassName("bannerD");
	bannernum = num;
	for (let i = 0; i < img.length; i++) {
		img[i].style.opacity = 0;
		img[i].style.zIndex = 0;
		D[i].style.backgroundColor = ""
	}
	img[bannernum].style.opacity = 1;
	img[bannernum].style.zIndex = 1;
	D[bannernum].style.backgroundColor = "#ffffff";
	playbanner();
}
// 菜单栏详情
function showitemdata() {
	var itemdata = document.getElementsByClassName("itemdata")[0];
	itemdata.style.border = "1px solid #e0e0e0";
	itemdata.style.width = 990 + "px";
}

function hideitemdata() {
	var itemdata = document.getElementsByClassName("itemdata")[0];
	itemdata.style.border = ""
	itemdata.style.width = 0;
}
// 智能穿戴的热门跟穿戴动画
function hostAdata(num) {
	var span1 = document.getElementsByClassName("p2-span1")[0];
	var span2 = document.getElementsByClassName("p2-span2")[0];
	var more = document.getElementsByClassName("cd-more")[0];
	var cdRight = document.getElementsByClassName("cd-right")[1];
	if (num == 1) {
		span1.style.borderBottom = "1px solid #ff6700";
		span1.style.color = "#ff6700";
		span2.style.borderBottom = "none";
		span2.style.color = "#333333";
		more.style.display = "none";
		cdRight.style.display = "flex";

	} else {
		span2.style.borderBottom = "1px solid #ff6700";
		span2.style.color = "#ff6700";
		span1.style.borderBottom = "none";
		span1.style.color = "#333333";
		more.style.display = "block";
		cdRight.style.display = "none";
	}
}
// 家电
function hostATv(num) {
	var span1 = document.getElementsByClassName("J-1")[0];
	var span2 = document.getElementsByClassName("J-2")[0];
	var more = document.getElementsByClassName("cd4-more")[0];
	var olddata = document.getElementsByClassName("cd4-right-1")[0];
	if (num == 1) {
		span1.style.borderBottom = "1px solid #ff6700";
		span1.style.color = "#ff6700";
		span2.style.borderBottom = "none";
		span2.style.color = "#333333";
		more.style.display = "none";
		olddata.style.display = "flex";

	} else {
		span2.style.borderBottom = "1px solid #ff6700";
		span2.style.color = "#ff6700";
		span1.style.borderBottom = "none";
		span1.style.color = "#333333";
		more.style.display = "block";
		olddata.style.display = "none";
	}
}
// 生活电器
function LifeElectric(n) {
	var s1 = document.getElementsByClassName("life-1")[0];
	var s2 = document.getElementsByClassName("life-2")[0];
	var s3 = document.getElementsByClassName("life-3")[0];
	var s4 = document.getElementsByClassName("life-4")[0];
	var m1 = document.getElementsByClassName("cd5-right-1")[0];
	var m2 = document.getElementsByClassName("cd5-more-2")[0];
	var m3 = document.getElementsByClassName("cd5-more-3")[0];
	var m4 = document.getElementsByClassName("cd5-more-4")[0];
	if (n == 1) {
		s1.style.borderBottom = "1px solid #ff6700";
		s1.style.color = "#ff6700";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m2.style.display = "none";
		m3.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "flex";

	} else if (n == 2) {
		s2.style.borderBottom = "1px solid #ff6700";
		s2.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m2.style.display = "block";
		m3.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "none";
	} else if (n == 3) {
		s3.style.borderBottom = "1px solid #ff6700";
		s3.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m3.style.display = "block";
		m2.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "none";
	} else if (n == 4) {
		s4.style.borderBottom = "1px solid #ff6700";
		s4.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		m4.style.display = "block";
		m3.style.display = "none";
		m2.style.display = "none";
		m1.style.display = "none";
	}
}
// 厨房电器
function KitchenElectric(n) {
	var s1 = document.getElementsByClassName("Kitchen-1")[0];
	var s2 = document.getElementsByClassName("Kitchen-2")[0];
	var s3 = document.getElementsByClassName("Kitchen-3")[0];
	var s4 = document.getElementsByClassName("Kitchen-4")[0];
	var m1 = document.getElementsByClassName("cd6-right-1")[0];
	var m2 = document.getElementsByClassName("cd6-more-2")[0];
	var m3 = document.getElementsByClassName("cd6-more-3")[0];
	var m4 = document.getElementsByClassName("cd6-more-4")[0];
	if (n == 1) {
		s1.style.borderBottom = "1px solid #ff6700";
		s1.style.color = "#ff6700";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m2.style.display = "none";
		m3.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "flex";

	} else if (n == 2) {
		s2.style.borderBottom = "1px solid #ff6700";
		s2.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m2.style.display = "block";
		m3.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "none";
	} else if (n == 3) {
		s3.style.borderBottom = "1px solid #ff6700";
		s3.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m3.style.display = "block";
		m2.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "none";
	} else if (n == 4) {
		s4.style.borderBottom = "1px solid #ff6700";
		s4.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		m4.style.display = "block";
		m3.style.display = "none";
		m2.style.display = "none";
		m1.style.display = "none";
	}
}
// 智能家居
function SmartHome(n) {
	var s1 = document.getElementsByClassName("SmartHome-1")[0];
	var s2 = document.getElementsByClassName("SmartHome-2")[0];
	var s3 = document.getElementsByClassName("SmartHome-3")[0];
	var s4 = document.getElementsByClassName("SmartHome-4")[0];
	var m1 = document.getElementsByClassName("cd7-right-1")[0];
	var m2 = document.getElementsByClassName("cd7-more-2")[0];
	var m3 = document.getElementsByClassName("cd7-more-3")[0];
	var m4 = document.getElementsByClassName("cd7-more-4")[0];
	if (n == 1) {
		s1.style.borderBottom = "1px solid #ff6700";
		s1.style.color = "#ff6700";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m2.style.display = "none";
		m3.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "flex";

	} else if (n == 2) {
		s2.style.borderBottom = "1px solid #ff6700";
		s2.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m2.style.display = "block";
		m3.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "none";
	} else if (n == 3) {
		s3.style.borderBottom = "1px solid #ff6700";
		s3.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m3.style.display = "block";
		m2.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "none";
	} else if (n == 4) {
		s4.style.borderBottom = "1px solid #ff6700";
		s4.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		m4.style.display = "block";
		m3.style.display = "none";
		m2.style.display = "none";
		m1.style.display = "none";
	}
}
// 运动出行 ExerciseTravel
function ExerciseTravel(n) {
	var s1 = document.getElementsByClassName("ExerciseTravel-1")[0];
	var s2 = document.getElementsByClassName("ExerciseTravel-2")[0];
	var s3 = document.getElementsByClassName("ExerciseTravel-3")[0];
	var s4 = document.getElementsByClassName("ExerciseTravel-4")[0];
	var m1 = document.getElementsByClassName("cd8-right-1")[0];
	var m2 = document.getElementsByClassName("cd8-more-2")[0];
	var m3 = document.getElementsByClassName("cd8-more-3")[0];
	var m4 = document.getElementsByClassName("cd8-more-4")[0];
	if (n == 1) {
		s1.style.borderBottom = "1px solid #ff6700";
		s1.style.color = "#ff6700";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m2.style.display = "none";
		m3.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "flex";

	} else if (n == 2) {
		s2.style.borderBottom = "1px solid #ff6700";
		s2.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m2.style.display = "block";
		m3.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "none";
	} else if (n == 3) {
		s3.style.borderBottom = "1px solid #ff6700";
		s3.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m3.style.display = "block";
		m2.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "none";
	} else if (n == 4) {
		s4.style.borderBottom = "1px solid #ff6700";
		s4.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		m4.style.display = "block";
		m3.style.display = "none";
		m2.style.display = "none";
		m1.style.display = "none";
	}
}
// 日用百货 Daily
function Daily(n) {
	var s1 = document.getElementsByClassName("Daily-1")[0];
	var s2 = document.getElementsByClassName("Daily-2")[0];
	var s3 = document.getElementsByClassName("Daily-3")[0];
	var s4 = document.getElementsByClassName("Daily-4")[0];
	var m1 = document.getElementsByClassName("cd9-right-1")[0];
	var m2 = document.getElementsByClassName("cd9-more-2")[0];
	var m3 = document.getElementsByClassName("cd9-more-3")[0];
	var m4 = document.getElementsByClassName("cd9-more-4")[0];
	if (n == 1) {
		s1.style.borderBottom = "1px solid #ff6700";
		s1.style.color = "#ff6700";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m2.style.display = "none";
		m3.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "flex";

	} else if (n == 2) {
		s2.style.borderBottom = "1px solid #ff6700";
		s2.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m2.style.display = "block";
		m3.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "none";
	} else if (n == 3) {
		s3.style.borderBottom = "1px solid #ff6700";
		s3.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		s4.style.borderBottom = "none";
		s4.style.color = "#333333";
		m3.style.display = "block";
		m2.style.display = "none";
		m4.style.display = "none";
		m1.style.display = "none";
	} else if (n == 4) {
		s4.style.borderBottom = "1px solid #ff6700";
		s4.style.color = "#ff6700";
		s1.style.borderBottom = "none";
		s1.style.color = "#333333";
		s3.style.borderBottom = "none";
		s3.style.color = "#333333";
		s2.style.borderBottom = "none";
		s2.style.color = "#333333";
		m4.style.display = "block";
		m3.style.display = "none";
		m2.style.display = "none";
		m1.style.display = "none";
	}
}
// 回到顶部显示
document.onscroll = function() {
	var backtop = document.getElementsByClassName("backtop")[0];
	if (window.pageYOffset > window.innerHeight) {
		backtop.style.display = "block";
	} else {
		backtop.style.display = "none"
	}
}
// 回到顶部
function backtop() {
	window.scrollY = 0;
}
// 显示手机APP二维码、
function showphoneApp() {
	var phoneAPP = document.getElementsByClassName("phoneAPP")[0];
	phoneAPP.style.left = -130 + "px";
	phoneAPP.style.opacity = 1;
	phoneAPP.style.visibility = "";
}

function hidephoneApp() {
	var phoneAPP = document.getElementsByClassName("phoneAPP")[0];
	phoneAPP.style.left = 0;
	phoneAPP.style.opacity = 0;
	phoneAPP.style.visibility = "hidden";
}
// input 内容跳动
function changeinputtext() {
	var text = ["冰箱", "红米", "小米手环7", "黑鲨", "Redmi G 2021", "手机", "洗衣机"];
	var textinex = 0;
	var input = document.getElementsByClassName("navinput")[0];
	input.placeholder = text[parseInt(Math.random() * 8)];
	setInterval(() => {
		input.placeholder = text[textinex];
		textinex++;
		if (textinex == text.length) {
			textinex = 0;
		}
	}, 2000);
}
// 播放视频
let Vbox = document.querySelector('.Vbox');
let video = document.querySelector('.video');
function playvideo(videosrc) {
	Vbox.style.display = 'block';
	video.src = videosrc
}

// 关闭按钮
let HideVideo = document.querySelector('.icon-guanbi');
HideVideo.addEventListener("click",()=>{
	Vbox.style.display = "none";
	video.pause();
})